﻿using Admin.NET.Core;
using Admin.NET.Core;

namespace Admin.NET.Application.SeedData;

/// <summary>
/// 系统角色表 表种子数据
/// </summary>
[IncreSeed]
public class SysRoleSeedData: ISqlSugarEntitySeedData<SysRole>
{
    /// <summary>
    /// 种子数据
    /// </summary>
    /// <returns></returns>
    public IEnumerable<SysRole> HasData()
    {
        string recordsJSON = @"
            [
			  {
			    ""Name"": ""系统管理员"",
			    ""Code"": ""sys_admin"",
			    ""OrderNo"": 100,
			    ""DataScope"": 1,
			    ""Remark"": ""系统管理员"",
			    ""Status"": 1,
			    ""TenantId"": 1300000000001,
			    ""CreateTime"": ""2023-12-22 13:20:31"",
			    ""UpdateTime"": ""2024-01-12 18:54:57"",
			    ""CreateUserId"": null,
			    ""CreateUserName"": null,
			    ""UpdateUserId"": null,
			    ""UpdateUserName"": null,
			    ""IsDelete"": false,
			    ""Id"": 1300000000101
			  },
			  {
			    ""Name"": ""本部门及以下数据"",
			    ""Code"": ""sys_deptChild"",
			    ""OrderNo"": 100,
			    ""DataScope"": 2,
			    ""Remark"": ""本部门及以下数据"",
			    ""Status"": 1,
			    ""TenantId"": 1300000000001,
			    ""CreateTime"": ""2023-12-22 13:20:31"",
			    ""UpdateTime"": ""2024-01-12 18:54:57"",
			    ""CreateUserId"": null,
			    ""CreateUserName"": null,
			    ""UpdateUserId"": null,
			    ""UpdateUserName"": null,
			    ""IsDelete"": false,
			    ""Id"": 1300000000102
			  },
			  {
			    ""Name"": ""本部门数据"",
			    ""Code"": ""sys_dept"",
			    ""OrderNo"": 100,
			    ""DataScope"": 3,
			    ""Remark"": ""本部门数据"",
			    ""Status"": 1,
			    ""TenantId"": 1300000000001,
			    ""CreateTime"": ""2023-12-22 13:20:31"",
			    ""UpdateTime"": ""2024-01-12 18:54:57"",
			    ""CreateUserId"": null,
			    ""CreateUserName"": null,
			    ""UpdateUserId"": null,
			    ""UpdateUserName"": null,
			    ""IsDelete"": false,
			    ""Id"": 1300000000103
			  },
			  {
			    ""Name"": ""仅本人数据"",
			    ""Code"": ""sys_self"",
			    ""OrderNo"": 100,
			    ""DataScope"": 4,
			    ""Remark"": ""仅本人数据"",
			    ""Status"": 1,
			    ""TenantId"": 1300000000001,
			    ""CreateTime"": ""2023-12-22 13:20:31"",
			    ""UpdateTime"": ""2024-01-12 18:54:57"",
			    ""CreateUserId"": null,
			    ""CreateUserName"": null,
			    ""UpdateUserId"": null,
			    ""UpdateUserName"": null,
			    ""IsDelete"": false,
			    ""Id"": 1300000000104
			  },
			  {
			    ""Name"": ""自定义数据"",
			    ""Code"": ""sys_define"",
			    ""OrderNo"": 100,
			    ""DataScope"": 5,
			    ""Remark"": ""自定义数据"",
			    ""Status"": 1,
			    ""TenantId"": 1300000000001,
			    ""CreateTime"": ""2023-12-22 13:20:31"",
			    ""UpdateTime"": ""2024-01-12 18:54:57"",
			    ""CreateUserId"": null,
			    ""CreateUserName"": null,
			    ""UpdateUserId"": null,
			    ""UpdateUserName"": null,
			    ""IsDelete"": false,
			    ""Id"": 1300000000105
			  },
			  {
			    ""Name"": ""学生"",
			    ""Code"": ""student"",
			    ""OrderNo"": 110,
			    ""DataScope"": 4,
			    ""Remark"": null,
			    ""Status"": 1,
			    ""TenantId"": 1300000000001,
			    ""CreateTime"": ""2024-01-12 09:01:25"",
			    ""UpdateTime"": ""2024-01-12 18:54:57"",
			    ""CreateUserId"": 1300000000101,
			    ""CreateUserName"": ""超级管理员"",
			    ""UpdateUserId"": null,
			    ""UpdateUserName"": null,
			    ""IsDelete"": false,
			    ""Id"": 31451157228869
			  },
			  {
			    ""Name"": ""教师"",
			    ""Code"": ""teacher"",
			    ""OrderNo"": 120,
			    ""DataScope"": 4,
			    ""Remark"": null,
			    ""Status"": 1,
			    ""TenantId"": 1300000000001,
			    ""CreateTime"": ""2024-01-12 18:38:54"",
			    ""UpdateTime"": ""2024-01-12 18:39:16"",
			    ""CreateUserId"": 1300000000101,
			    ""CreateUserName"": ""超级管理员"",
			    ""UpdateUserId"": 1300000000101,
			    ""UpdateUserName"": ""超级管理员"",
			    ""IsDelete"": false,
			    ""Id"": 31460027383109
			  }
			]
        ";
        List<SysRole> records = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SysRole>>(recordsJSON);
        
        // 后处理数据的特殊字段
		//for (int i = 0; i < records.Count; i++) { }

        return records;
    }
}